<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<%@ page import="studio7.negocio.AdministradorNegocio"%>
	<%@ page import="studio7.modelo.Sala"%>
	<%@ page import="studio7.modelo.Servicio"%>
	<%@ page import="studio7.modelo.Instrumento"%>
	<%@page import="java.util.*"%>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Armado de Sala</title>
	</head>
	<%
	String contextpath = request.getContextPath();
	%>
	
	<body>
		<form name="inicio" action="armadoSala1" method="post" style="height: 465px; width: 799px">
			
			
			
			
			
			
			<br><br>
			
			<%
			Object objMsg = request.getAttribute("msg");
			if(objMsg != null){
				String msg = objMsg.toString();
			%>
				<table>
					<tr>
						<td>
							<%=msg%>
						</td>
					</tr>
				</table>
			<%
			}
			%>
			
			<table>
				<tr>
					<td>
						Sala:<br/>
						<select size="1" name="idSala" style="width: 122px; ">
							<%
							Object obj = session.getAttribute("arraySala");
							if(obj != null){
								Collection<Sala> col = ( Collection<Sala> ) obj;
								System.out.println("col --> " + col.size());
								Iterator<Sala> i = col.iterator();
								for(int j = 0; j < col.size(); j++){
									Sala sala = i.next();
							%>
								<option value="<%=sala.getIdSala()%>" selected><%=sala.getNombreSala()%></option>
								<%
								}
							}else{
								System.out.println("request es nulo");
							}
							%>
						</select>	
					</td>
					<td style="width: 261px; ">Servicio:<br/>
						<select size="1" name="idServicio" style="width: 126px; ">
							<%
							obj = session.getAttribute("arrayServicio");
							if(obj != null){
								Collection<Servicio> col = ( Collection<Servicio> ) obj;
								Iterator<Servicio> i2 = col.iterator();
								while(i2.hasNext()){
									Servicio servicio = i2.next();
							%>
								<option value="<%=servicio.getIdServicio()%>" selected><%=servicio.getNombreServicio()%></option>
								<%
								}
							}	
							%>
						</select>
					</td>
				</tr>
				<tr>
					<td style="width: 405px; ">
						Costo por Hora:
						<input type="text" name="costoXHora" />
					</td>
					<td style="width: 234px; ">
					</td>
				</tr>
				<tr>
					<td>
					</td>
					<td align="right">
						<input type="submit" value="Paso 2"/>
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>